import React from "react";
import { Navigate } from "react-router-dom";
import { getCookie } from "../../util/cookie";
console.log(getCookie(), "?????");
function AuthRoute({ children }) {
  const token = getCookie();
  if (token) {
    return <>{children}</>;
  } else {
    return <Navigate to={"/login"}></Navigate>;
  }
}
export default AuthRoute;
